import request from '@/utils/request'


//验收物品
export function addGood(acceptId, name, specification, unit, type, yesorno) {
  return request({
    url: '/entryWarehouse/accept-goods/addGood',
    method: 'post',
    data: {
      acceptId: acceptId,
      name: name,
      specification: specification,
      unit: unit,
      type: type,
      yesorno: yesorno
    }
  })
}

//更改验收信息
export function editGood(id, acceptId, name, specification, unit, type, billNum, price, tax, yesNum, noNum,
  shortage, surplus, position, remark) {
  return request({
    url: '/entryWarehouse/accept-goods/editGood',
    method: 'post',
    data: {
      id: id,
      acceptId: acceptId,
      name: name,
      specification: specification,
      unit: unit,
      type: type,
      billNum: billNum,
      price: price,
      tax: tax,
      yesNum: yesNum,
      noNum: noNum,
      shortage: shortage,
      surplus: surplus,
      position: position,
      remark: remark
    }
  })
}

//删除物品
export function removeGood(id) {
  return request({
    url: '/entryWarehouse/accept-goods/removeGood',
    method: 'post',
    params:{
      id: id
    }
  })
}

//加载未完成验收记录通过编号
export function selectById(acceptId) {
  return request({
    url: '/entryWarehouse/accept-goods/selectById',
    method: 'get',
    params:{
      acceptId: acceptId
    }
  })
}
